oracle.pgx.api

## Class Destroyable

- java.lang.Object
- - oracle.pgx.api.Destroyable

- All Implemented Interfaces:
    AutoCloseable
  Direct Known Subclasses:
    AllPaths, Analyst, Partition, PgxManagedObject, PgxPath

      public abstract class Destroyable
      extends Object
      implements AutoCloseable

  Sub-classes of Destroyable can be explicitly destroyed

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Destroyable()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Calls `destroyAsync()` without waiting for completion.
    `void` | `destroy()` Blocking version of `destroyAsync()`.
    `PgxFuture<Void>` | `destroyAsync()` Requests destruction of this object.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Destroyable

          public Destroyable()

  - ### Method Detail

    - #### close

          public final void close()

      Calls `destroyAsync()` without waiting for completion.
      Specified by:
        `close` in interface `AutoCloseable`

    - #### destroy

          public void destroy()
                       throws InterruptedException,
                              ExecutionException

      Blocking version of `destroyAsync()`. Calls `destroyAsync()` and waits for the returned `PgxFuture` to complete.
      Throws:
        `InterruptedException` - if the caller thread gets interrupted while waiting for completion.
        `ExecutionException` - if any exception occurred during asynchronous execution. The actual exception will be nested.

    - #### destroyAsync

          public final PgxFuture<Void> destroyAsync()

      Requests destruction of this object. After this method returns, the behavior of any method of this class becomes undefined.
      Returns:
        a future which will be completed once the destruction request finishes.

Copyright © 2015. All rights reserved.